module.exports = class Table {
  constructor({
    name = "My Table",
    ref = "A1",
    headerRow = true,
    totalRow = true,
    theme = "TableStyleMedium2"
  }) {
    this.name = name;
    this.ref = ref;
    this.headerRow = headerRow;
    this.totalRow = totalRow;
    this.columns = [];
    this.rows = [];
    this.theme = theme;
    this.initStyle();
  }
  initStyle() {
    this.style = {
      theme: this.theme,
      showRowStripes: true,
    };
  }
  addColumn(column) {
    this.columns.push(column);
  }
  addRow({ row }) {
    this.rows.push([...row]);
  }
  resetTable() {
    this.columns = [];
    this.rows = [];
    this.initStyle();
  }
};
